package pl.put.augrelshooter.dataproviders;

import java.util.ArrayList;
import java.util.List;

import pl.put.augrelshooter.R;
import pl.put.augrelshooter.activities.JoinGameActivity;
import pl.put.augrelshooter.activities.NewGameActivity;
import pl.put.augrelshooter.adapters.items.MainMenuItem;
import android.content.Context;
import android.content.Intent;

public class MainMenuDataProvider {
	private Context contex;

	public MainMenuDataProvider(Context context) {
		this.contex = context;
	}

	public MainMenuItem[] getAllMainMenuItems() {
		List<MainMenuItem> mainMenuItems = new ArrayList<MainMenuItem>();

		Intent startIntent = new Intent(contex, NewGameActivity.class);
		mainMenuItems.add(new MainMenuItem(contex.getResources().getString(R.string.main_menu_start_game), startIntent));

		Intent joinIntent = new Intent(contex, JoinGameActivity.class);
		mainMenuItems.add(new MainMenuItem(contex.getResources().getString(R.string.main_menu_join_game), joinIntent));

		Intent exitIntent = new Intent(Intent.ACTION_MAIN);
		exitIntent.addCategory(Intent.CATEGORY_HOME);
		exitIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		mainMenuItems.add(new MainMenuItem(contex.getResources().getString(R.string.main_menu_exit), exitIntent));

		return mainMenuItems.toArray(new MainMenuItem[0]);
	}
}
